var sign = require('./sign.js');

exports.getUserList = function(req,res){
	sign.dataReq(req,req.session.token,req.body,'user/getList','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}else{
			res.send('暂时没有数据');
		}
	})
}
exports.userGetRoleList = function(req,res){
  sign.nullDataReq(req,req.session.token,'user/getRoleList','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}
exports.delUser = function(req,res){
  console.log(req.body);
  sign.dataReq(req,req.session.token,req.body,'user/delUser','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}
exports.addUser = function(req,res){
   console.log(req.body);
  sign.dataReq(req,req.session.token,req.body,'user/addUser','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}
exports.editUser = function(req,res){
	console.log(req.body);
	sign.dataReq(req,req.session.token,req.body,'user/editUser','post',function(ResData){
		if(ResData!=''){
			console.log(ResData)
			res.send(ResData);
		}
	})
}
exports.addRole = function(req,res){
	console.log(req.body)
  sign.dataReq(req,req.session.token,req.body,'role/addRole','post',function(ResData){
		
		if(ResData!=''){
			console.log(ResData);
			res.send(ResData);
		}
	})
}
exports.editRole = function(req,res){
	console.log(req.body);
	sign.dataReq(req,req.session.token,req.body,'role/editRole','post',function(ResData){
		if(ResData!=''){
			console.log(ResData);
			res.send(ResData);
		}
	})
}
exports.getRoleList = function(req,res){
  sign.dataReq(req,req.session.token,req.body,'role/getList','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}else{
			res.send('暂时没有数据');
		}
	})
}
exports.delRole = function(req,res) {
	console.log(req.body)
	sign.dataReq(req,req.session.token,req.body,'role/delRole','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}
exports.getRightInfoList = function(req,res){
	sign.dataReq(req,req.session.token,req.body,'/role/getRightInfoList','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}